# Contributor: Grigory Kirillov <txgk@bk.ru>
# Maintainer:
pkgname=libiml
pkgver=1.0.5
pkgrel=3
pkgdesc="Library for solving linear equations over the integers"
url="https://cs.uwaterloo.ca/~astorjoh/iml.html"
arch="all"
license="BSD-3-Clause"
makedepends="gmp-dev openblas-dev pkgconf"
source="https://www.cs.uwaterloo.ca/~astorjoh/iml-$pkgver.tar.bz2"
subpackages="$pkgname-static $pkgname-dev"
builddir="$srcdir/iml-$pkgver"

prepare() {
	default_prepare
	update_config_guess
	update_config_sub
}

build() {
	export CFLAGS="${CFLAGS/-Os/-O3}" # gotta go fast

	./configure \
		--target="$CTARGET" \
		--build="$CBUILD" \
		--host="$CHOST" \
		--prefix=/usr \
		--enable-shared \
		--with-cblas="$(pkgconf --libs openblas)"
	make
}

check() {
	make check
}

package() {
	make DESTDIR="$pkgdir" install
}

sha512sums="
b5a85982636035cc50acba7dcff5478c6271be3669313f01915b2761302d4c77617c0dd7932daf74433098670d3ffdb2ef19eb24450b40709750a0b7c8f797f1  iml-1.0.5.tar.bz2
"
